<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ajax extends MY_Controller {

	function Ajax()
	{
		parent::MY_Controller();
	}

	function servers($area_id){
		if (!$area_id) {
			echo '';exit;
		}
		$this->load->model('Mgames');
		$servers = $this->Mgames->get_game_servers($area_id);
		$html = '<select name="game_server" id="game_server">';
		$html .= '<option value="0">请选择</option>';
		foreach ($servers as $server){
			$html .= '<option value="'.$server['server_id'].'">'.$server['server_name'].'</option>';
		}
		$html .= '</select>';
		echo $html;
	}

    function agent($area_id) {
        if (!$area_id) {
			echo '';exit;
		}
        $this->load->model('Magent');
		$agents = $this->Magent->get_agents($area_id,0,1000);
		$html = '<select name="agent_id" id="agent_id">';
		foreach ($agents as $agent){
			$html .= '<option value="'.$agent['agent_no'].'">'.$agent['agent_no'].'</option>';
		}
		$html .= '</select>';
		echo $html;
    }

}

?>